package com.leo.train.batch.feign;

import com.leo.train.common.resp.CommonResp;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Date;

// 访问的微服务名称，微服务名称为train-business，url为微服务的地址
@FeignClient(name = "train-business") // 使用nacos配置服务名称
//@FeignClient(name = "train-business",url = "http://127.0.0.1:8082/business")
public interface BusinessFeign {
    @GetMapping("/business/business/hello")  // 调用business那个接口的地址
    String hello1();

    // 根据日期生成每次车次
    @GetMapping("/business/admin/daily-train/gen-daily/{date}")
    CommonResp genDaily(@PathVariable @DateTimeFormat(pattern = "yyyy-MM-dd") Date date);

}
